export interface IEvents {
	[event: string]: string;
}

export interface IActions {
	[atom: string]: (...args: any[]) => Promise<unknown> | unknown;
}

export interface IFeidaoAi {
	readonly data: {
		readonly [attr: string]: unknown;
	};
	fire(action: string, ...args: any[]): Promise<unknown>;
	emit(event: string, ...args: any[]): Promise<unknown>;
}

import { IHandle } from '@feidao-factory/core/on';

export interface IFeidaoAiDesktopComponent extends IFeidaoAi {
	readonly data: {
		readonly [attr: string]: unknown;
		readonly no: string;
		readonly node: HTMLElement;
		readonly params: {
			[key: string]: unknown;
		};
		readonly url: string;
	};
	parse_event(node: HTMLElement | DocumentFragment): IHandle[];
}

export interface IFeidaoAiDesktopPage extends IFeidaoAi {
	readonly data: {
		readonly [attr: string]: unknown;
		readonly params: {
			[key: string]: unknown;
		};
		readonly url: string;
	};
}

export interface IFeidaoAiDesktopApp extends IFeidaoAi {
	readonly data: {
		readonly spaceid: string;
	};
}
